﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.Text;
using System.Drawing;
using System.Runtime.InteropServices;

namespace CarlowPitBoy
{
    static class UniversalProperties
    {
        [DllImport("user32.dll")]
        private static extern bool GetCursorPos(ref Point storePoint);

        private static Screen _startingScreen = Screen.PrimaryScreen;

        private static double _kilosOfRam;
        private static double _megsOfRam;
        private static double _gigsOfRam;
        
        public static Point mousePosition;

        public static double kilosOfRam
        {
            get
            {
                _kilosOfRam = GC.GetTotalMemory(false) / 1000;//thousand for kilos
                return _kilosOfRam;
            }
        }

        public static double megsOfRam
        {
            get
            {
                _megsOfRam = GC.GetTotalMemory(false) / 1000000;//million for megs
                return _megsOfRam;
            }
        }

        public static double gigsOfRam
        {
            get
            {
                _gigsOfRam = GC.GetTotalMemory(false) / 1000000000;//billion for gigs
                return _gigsOfRam;
            }
        }

        public static void updateMousePosition()
        {
            GetCursorPos(ref mousePosition);
        }

        /// <summary>
        /// Original properties of primary screen
        /// </summary>
        public static Screen originalPrimaryScreen
        {
            get { return _startingScreen; }
            ///// <summary>
            ///// The properties of the current screen
            ///// </summary>
            //public static int currentWidth
            //{
            //    get
            //    {
            //        return Screen.PrimaryScreen.Bounds.Width;
            //    }
            //    set
            //    {
            //        //Screen.PrimaryScreen.Bounds.Width = value;
            //    }
            //}
            //public static int cuurentHeight { get; set; }

            ///// <summary>
            ///// The resolution of the screen before this program was run
            ///// </summary>
            //public static Screen startingScreen { get { return _startingScreen; } }

        }
    }
}
